import request from '@/utils/request'

// 查询客户管理列表
export function listLpBase(query) {
  return request({
    url: '/base/lpBase/list',
    method: 'get',
    params: query
  })
}

// 查询客户管理列表 所有
export function findLpList(query) {
  return request({
    url: '/base/lpBase/listAllLpBase',
    method: 'get',
    params: query
  })
}

// 查询客户管理详细
export function getLpBase(id) {
  return request({
    url: '/base/lpBase/' + id,
    method: 'get'
  })
}

// 校验出资人名称是否重复
export function checkLpName(name) {
  return request({
    url: '/base/lpBase/checkLpName?name=' + name,
    method: 'get'
  })
}

// 保存客户管理
export function saveLpBase(data) {
  return request({
    url: '/base/lpBase/save',
    method: 'post',
    data: data
  })
}

// 获取投资架构图数据
export function getLpInvestChart(query) {
  return request({
    url: '/base/lpBase/getLpInvestChart',
    method: 'get',
    params: query
  })
}

// 删除客户管理
export function delLpBase(id) {
  return request({
    url: '/base/lpBase/' + id,
    method: 'delete'
  })
}

// 导出客户管理
export function exportLpBase(query) {
  return request({
    url: '/base/lpBase/export',
    method: 'get',
    params: query
  })
}

// 校验全称是否已存在
export function checkCustomerName(query) {
  return request({
    url: '/base/lpBase/checkCustomerName/',
    method: 'get',
    params: query
  })
}

// 出资人投资信息
export function findInvestFundInfo(query) {
  return request({
    url: '/base/lpBase/findInvestFundInfo/' + query.id,
    method: 'get',
    params: query
  })
}
// 出资人投资项目信息
export function findInvestDealInfo(query) {
  return request({
    url: '/base/lpBase/findInvestDealInfo',
    method: 'get',
    params: query
  })
}

// 出资人缴款明细
export function findPaymentDetails(query) {
  return request({
    url: '/base/lpBase/findPaymentDetails/' + query.id,
    method: 'get',
    params: query
  })
}

// 缴款明细统计信息
export function findPaymentDetailsCountInfo(id) {
  return request({
    url: '/base/lpBase/findPaymentDetailsCountInfo/' + id,
    method: 'get'
  })
}

// 根据LPid获取对象
export function getByLpId(lpId) {
  return request({
    url: '/lpPortal/login/getByLpId/' + lpId,
    method: 'get'
  })
}

// 新增开通用户
export function saveAccountUser(data) {
  return request({
    url: '/lpPortal/login/saveLpAccount',
    method: 'post',
    data: data
  })
}

// 注销账户
export function delLpAccount(id) {
  return request({
    url: '/lpPortal/login/delLpAccount/' + id,
    method: 'get'
  })
}

// 校验账号是否存在
export function verifyThatTheAccountExists(userName) {
  return request({
    url: '/lpPortal/login/verifyThatTheAccountExists/' + userName,
    method: 'get'
  })
}

// lp公式公告出资人列表
export function findLpBaseList(query) {
  return request({
    url: '/base/lpBase/findLpBaseList',
    method: 'get',
    params: query
  })
}

// 根据Lpid 获取对应的子表银行列表信息
export function findLpBaseBankAccountByLpId(lpId) {
  return request({
    url: '/base/lpBase/findLpBaseBankAccountByLpId/' + lpId,
    method: 'get'
  })
}

// 获取全部出资人ID和名称
export function getAllIdAndName() {
  return request({
    url: '/base/lpBase/getAllIdAndName',
    method: 'get'
  })
}

// 根据分配其次 获取该其次下的出资人
export function showFpInvestor(id) {
  return request({
    url: '/base/lpBase/showFpInvestor/' + id,
    method: 'get'
  })
}

export function lpAccountEmailGetByLpId(lpId) {
  return request({
    url: '/base/lpBase/lpAccountEmail/getByLpId/' + lpId,
    method: 'get'
  })
}

export function saveLpPortalAccountEmail(data) {
  return request({
    url: '/base/lpBase/lpAccountEmail/save',
    method: 'post',
    data: data
  })
}

export function lpAccountEmailGetMsg() {
  return request({
    url: '/base/lpBase/lpAccountEmail/getMsg',
    method: 'get'
  })
}
